package model

import "global/structs"

// 'buyin','buyout','salein','saleout','exchange_in','exchange_out','fee'

const (
	ASSET_TYPE_BUYIN       = "buy_in"
	ASSET_TYPE_BUYOUT      = "buy_out"
	ASSET_TYPE_SALEIN      = "sale_in"
	ASSET_TYPE_SALEOUT     = "sale_out"
	ASSET_TYPE_EXCHANGEIN  = "exchange_in"
	ASSET_TYPE_EXCHANGEOUT = "exchange_out"
	ASSET_TYPE_FEE         = "fee"
)

const (
	OTE_LOG_ERRCODE_REDIS  = 1 		// Redis 错误
	OTE_LOG_ERRCODE_DB 	   = 2 		// DB 错误
)

type oteLogModel struct{}

var OteLogModel = new(oteLogModel)

// 插入一条记录
func (oteLogModel) Insert(log *structs.OteLog) (bool, error) {
	row, err := MainDB.InsertOne(log)
	return row > 0, err
}
